package com.suncaper.demo.controller;

import com.suncaper.demo.entity.User;
import com.suncaper.demo.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class IndexController {
    @Autowired
    UserMapper userMapper;

    @RequestMapping("hallo")
    @ResponseBody
    public User hh(Model model){
        User user = userMapper.selectByPrimaryKey(1);
        model.addAttribute("msg","hallo");
        return user;
    }


}
